import React from 'react'
import { Router, Route, Switch } from 'react-router-dom'
import Login from '@/pages/Login'
import Layout from '@/pages/Layout'
import NotFound from '@/pages/NotFound'
import history from './utils/history'
import PrivateRoute from '@/components/PrivateRoute'

export default function App () {
  return (
    <div className="app">
      <Router history={history}>
        <Switch>
          <Route path="/login" component={Login} />
          <PrivateRoute path="/home" component={Layout} />
          {/* 增加一个404 */}
          <Route component={NotFound} />
        </Switch>
      </Router>
    </div>
  )
}
